home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _ADDTAIL.C next >
Text File  |  1992-11-21  |  2KB  |  59 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3.  
  4. #ifdef REGISTERWINDOWS
  5. #ifndef        NDEBUG
  6. char *rcsid__addtail = "$Header: c:/curses/private/RCS/_addtail.c%v 2.0 1992/11/15 03:24:17 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   PDC_addtail()        - add window to the visible window list
  15.  
  16.   PDCurses Description:
  17.        This is a private PDCurses function.
  18.  
  19.        This routine adds the passed window pointer to the end fo the
  20.        visible window list.  All windows on this list will automatically
  21.        be refreshed if _cursvar.refreshall is true.
  22.  
  23.   PDCurses Return Value:
  24.        This function returns OK upon success otherwise ERR is returned.
  25.  
  26.   PDCurses Errors:
  27.        It is an error to pass a NULL window pointer.
  28.  
  29.   Portability:
  30.        PDCurses        int     PDC_addtail( WINDOW* tail );
  31.  
  32. **man-end**********************************************************************/
  33.  
  34. int    PDC_addtail(WINDOW *tail)
  35. {
  36.        WINDS  *next = _cursvar.visible;
  37.  
  38.        if  (tail == (WINDOW *)NULL)
  39.                return( ERR );
  40.  
  41.        while (next != (WINDS *)NULL)
  42.        {
  43.                if (next->next == NULL)
  44.                        break;
  45.                next = next->next;
  46.        }
  47.        if (next == NULL)
  48.                PDC_inswin(tail, (WINDOW *)NULL);
  49.        else
  50.        {
  51.                if (next->w == NULL)
  52.                        PDC_inswin(tail, (WINDOW *)NULL);
  53.                else
  54.                        PDC_addwin(tail, next->w);
  55.        }
  56.        return( OK );
  57. }
  58. #endif
  59.